home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / v cisle / autoit / autoit-v3.2.0.1-setup.exe / Examples / Helpfile / GUIGetCursorInfo.au3 < prev    next >
Text File  |  2006-06-17  |  431b  |  21 lines

  1. #include <GUIConstants.au3>
  2. $IDC = 0
  3. HotkeySet("{Esc}", "GetPos")
  4.  
  5. GUICreate("Press Esc to Get Pos", 400, 400)
  6. $x=GUICtrlCreateLabel ("0", 10, 10,50)
  7. $y=GUICtrlCreateLabel ("0", 10, 30,50)
  8. GUISetState()
  9.  
  10. ; Run the GUI until the dialog is closed
  11. Do
  12. $msg = GUIGetMsg()
  13. Until $msg = $GUI_EVENT_CLOSE
  14. Exit
  15.  
  16. Func GetPos()
  17.     $a=GUIGetCursorInfo()
  18.     GUIctrlSetData($x,$a[0]) 
  19.     GUIctrlSetData($y,$a[1]) 
  20. EndFunc
  21.